'''
Created on 2011-5-13

@author: tie
'''

A=[[1,0,4],
   [2,1,1],
   [3,1,0],
   [0,2,2]
   ]
B=[[2,4],
   [1,1],
   [3,0]
   ]

m=len(A)
n=len(B[0])
k=len(B)

C=[[0 for i in range(n)]for j in range(m)]

for i in range(m):
    for j in range(n):
        for q in range(k):
            C[i][j]+=A[i][q]*B[q][j]
print(C)